package com.sptpc.demo.global.exception;

import com.sptpc.demo.global.response.BusinessStatusCode;
import lombok.Getter;

public class BusinessException extends RuntimeException{
    @Getter
    private BusinessStatusCode errorCode;

//    只封装错误消息
    public BusinessException(String errMsg){
        super(errMsg);
        this.errorCode = BusinessStatusCode.FAILURE;
    }

//    封装返回码和错误消息
    public BusinessException(BusinessStatusCode errCode){
        super(errCode.getMsg());
        this.errorCode = errCode;
    }



}
